//
//  ViewController.swift
//  UIViewAndCALayer
//
//  Created by fuyoufang on 2021/10/27.
//

import UIKit

class ViewController: UIViewController {

    let tipView = PopView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        tipView.backgroundColor = .orange
        tipView.frame = CGRect(x: 30, y: 30, width: 100, height: 150)
        view.addSubview(tipView)
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        UIView.popAnimation(duration: 1) {
            tipView.frame = CGRect(x: 40, y: 40, width: 150, height: 200)
            tipView.backgroundColor = .red
        }
    }
}
